#define RLS 0
#define RCD 1
#define GET 2
#define PUT 3
#define INIT 666
#define OK 0
#define ERROR -1
#define ACK 4
#define QUIT 5
#define RQC 6
#define DATA_LENGTH 512 - (2*sizeof(long) + 3*sizeof(int))
#define MAX_STRING_SIZE 50000
#define TIMEOUT 1000
#define RE_ATTEMPTS 3
struct sockaddr_in dir;

struct package {
    long from;
    long to;
    int op;
    int block_count;
    int offset;
    char data[DATA_LENGTH];
};
typedef struct package PACKAGE;

extern int rls(PACKAGE *);
extern int rcd(PACKAGE *);
extern int get(PACKAGE *);
extern int put(PACKAGE *);
extern int exit_client(PACKAGE *);

int open_socket(struct sockaddr_in *);
